package pattern.chain_of_responsibility.login;

// 校验用户名或密码是否为空
public class ValidateHandler extends Handler {
    @Override
    public void doHandler(User user) {
        if (user.getUsername() == null || "".equals(user.getUsername())
        || user.getPassword() == null || "".equals(user.getPassword())) {
            System.out.println("用户名或密码为空");
            return;
        }
        System.out.println("校验通过");
        next.doHandler(user);
    }
}
